<?php
class User{
	
	public static function login_user($login,$pass){
		$sql_query = mysql_query("Select name,md5 from ".DATABASE_TABLE_USER." ORDER BY `id` ASC");
		while ($query = mysql_fetch_array($sql_query)){
			if ($query['name'] == $login){
				if ($query['md5']== md5($pass)){
					$_SESSION['exist']=1;
					add_log("Connection of ".$query['name']);
					return true;
				}
			}
		}
		add_log("Tentative de connection de  ".$login);
		return false;
	}
	
	public static function disconnect_user(){
			$_SESSION['exist']=0;
	}
	
}
?>